$(document).ready(function(){
	access_token = $('.accessToken').val();
	if($.getCookie("access_token") == null || access_token != ""){
		$.setCookie("access_token", access_token);
	}
	else if(access_token == ""){
		access_token = $.getCookie("access_token");
	}

	$.getJSON("/"+server+"/UserGet?access_token="+access_token+requestLast,function(json){
		if(json.result == 1){
			$('.head-image').attr('src',json.user.headImage);
			$('.nickname').text(json.user.nickName);
			// $('.mobile').text(json.user.mobile);
			$('.money').text("余额 "+parseFloat(json.user.money).toFixed(1));
			$('.premoney').text("押金 "+parseFloat(json.user.preMoney).toFixed(1));
			$('.numberAccount').text("账号 "+json.user.numberAccount);
		}
	})	
	//提现页面
	$('.money-info').click(function(){
		window.location.href="/"+server+"/userMoney?type=1"; 
	})
	//优惠
	$('.coupon').click(function(){
		window.location.href="/"+server+"/userTicket"; 
	})
	//租借记录
	$('.record').click(function(){
		window.location.href="/"+server+"/borrowRecord"; 
	})
	//帮助
	$('.help').click(function(){
		window.location.href="/"+server+"/helpCenter"; 
	})
	//下载
	$('.app-download').click(function(){
		window.location.href="http://downloads.imlaidian.com";
	})	
	//提现
	$('.pickup').click(function(){
		window.location.href="/"+server+"/userMoney?type=2&access_token="+access_token; 
	})
	//充值
	$('.charge').click(function(){
		window.location.href="/"+server+"/userMoney?type=3"; 
	})
	//提现记录
	$('.pickup-record').click(function(){
		window.location.href="/"+server+"/userMoney?type=4"; 
	})				
})